package com.example.attribute_animation;

import android.animation.TypeEvaluator;

public class FloatEvaluator implements TypeEvaluator {
    @Override
    public Object evaluate(float fraction, Object startValue, Object endValue) {
        Point pointStart = (Point) startValue;
        Point pointEnd   = (Point) endValue;

        Float pointX = pointStart.getX() + fraction * (pointEnd.getX() - pointStart.getX());
        Float pointY = pointStart.getY() + fraction * (pointEnd.getY() - pointStart.getY());
        return new Point(pointX,pointY);
    }
}
